package com.spooky.esb.bean.parser;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.spooky.esb.entity.Spooky;

public class SpookyBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
	@Override
	protected Class getBeanClass(Element element) {
		return Spooky.class;
	}

	@Override
	protected void doParse(Element element, BeanDefinitionBuilder bean) {
		NodeList childNodes = element.getChildNodes();
		for (int i = 0; i < childNodes.getLength(); ++i) {
			Node item = childNodes.item(i);
			if (item.getNodeName().equalsIgnoreCase("flow")) {
				// Flow flow = new Flow(item.);
				// bean.addPropertyReference("addFlow", flow);
			}
		}
	}
}
